package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the ORDERCANCEL database table.
 * 
 */
@Entity
@NamedQuery(name="Ordercancel.findAll", query="SELECT o FROM Ordercancel o")
public class Ordercancel implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ORDERCANCEL_OCID_GENERATOR", sequenceName="SEQ_30")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ORDERCANCEL_OCID_GENERATOR")
	@Column(name="OC_ID")
	private long ocId;

	@Column(name="OC_CO_ID")
	private BigDecimal ocCoId;

	@Column(name="OC_CO_THEME")
	private String ocCoTheme;

	@Column(name="OC_CUS_ID")
	private BigDecimal ocCusId;

	@Column(name="OC_CUS_NAME")
	private String ocCusName;

	@Column(name="OC_HAVE_REFUND")
	private BigDecimal ocHaveRefund;

	@Column(name="OC_SH_REFUND")
	private BigDecimal ocShRefund;

	@Column(name="OC_STATE")
	private String ocState;

	@Temporal(TemporalType.DATE)
	@Column(name="OC_TIME")
	private Date ocTime;

	//bi-directional many-to-one association to ConstactOrder
	@OneToMany(mappedBy="ordercancel")
	private List<ConstactOrder> constactOrders;

	//bi-directional many-to-one association to ConstactOrder
	@ManyToOne
	@JoinColumn(name="CO_ID")
	private ConstactOrder constactOrder;

	//bi-directional many-to-one association to Customerinfo
	@ManyToOne
	@JoinColumn(name="CUST_ID")
	private Customerinfo customerinfo;

	//bi-directional many-to-one association to Ordercanceldetail
	@OneToMany(mappedBy="ordercancel")
	private List<Ordercanceldetail> ordercanceldetails;

	public Ordercancel() {
	}

	public long getOcId() {
		return this.ocId;
	}

	public void setOcId(long ocId) {
		this.ocId = ocId;
	}

	public BigDecimal getOcCoId() {
		return this.ocCoId;
	}

	public void setOcCoId(BigDecimal ocCoId) {
		this.ocCoId = ocCoId;
	}

	public String getOcCoTheme() {
		return this.ocCoTheme;
	}

	public void setOcCoTheme(String ocCoTheme) {
		this.ocCoTheme = ocCoTheme;
	}

	public BigDecimal getOcCusId() {
		return this.ocCusId;
	}

	public void setOcCusId(BigDecimal ocCusId) {
		this.ocCusId = ocCusId;
	}

	public String getOcCusName() {
		return this.ocCusName;
	}

	public void setOcCusName(String ocCusName) {
		this.ocCusName = ocCusName;
	}

	public BigDecimal getOcHaveRefund() {
		return this.ocHaveRefund;
	}

	public void setOcHaveRefund(BigDecimal ocHaveRefund) {
		this.ocHaveRefund = ocHaveRefund;
	}

	public BigDecimal getOcShRefund() {
		return this.ocShRefund;
	}

	public void setOcShRefund(BigDecimal ocShRefund) {
		this.ocShRefund = ocShRefund;
	}

	public String getOcState() {
		return this.ocState;
	}

	public void setOcState(String ocState) {
		this.ocState = ocState;
	}

	public Date getOcTime() {
		return this.ocTime;
	}

	public void setOcTime(Date ocTime) {
		this.ocTime = ocTime;
	}

	public List<ConstactOrder> getConstactOrders() {
		return this.constactOrders;
	}

	public void setConstactOrders(List<ConstactOrder> constactOrders) {
		this.constactOrders = constactOrders;
	}

	public ConstactOrder addConstactOrder(ConstactOrder constactOrder) {
		getConstactOrders().add(constactOrder);
		constactOrder.setOrdercancel(this);

		return constactOrder;
	}

	public ConstactOrder removeConstactOrder(ConstactOrder constactOrder) {
		getConstactOrders().remove(constactOrder);
		constactOrder.setOrdercancel(null);

		return constactOrder;
	}

	public ConstactOrder getConstactOrder() {
		return this.constactOrder;
	}

	public void setConstactOrder(ConstactOrder constactOrder) {
		this.constactOrder = constactOrder;
	}

	public Customerinfo getCustomerinfo() {
		return this.customerinfo;
	}

	public void setCustomerinfo(Customerinfo customerinfo) {
		this.customerinfo = customerinfo;
	}

	public List<Ordercanceldetail> getOrdercanceldetails() {
		return this.ordercanceldetails;
	}

	public void setOrdercanceldetails(List<Ordercanceldetail> ordercanceldetails) {
		this.ordercanceldetails = ordercanceldetails;
	}

	public Ordercanceldetail addOrdercanceldetail(Ordercanceldetail ordercanceldetail) {
		getOrdercanceldetails().add(ordercanceldetail);
		ordercanceldetail.setOrdercancel(this);

		return ordercanceldetail;
	}

	public Ordercanceldetail removeOrdercanceldetail(Ordercanceldetail ordercanceldetail) {
		getOrdercanceldetails().remove(ordercanceldetail);
		ordercanceldetail.setOrdercancel(null);

		return ordercanceldetail;
	}

}